package org.dcarew.stripjar;

public class Utils {

  /**
   * Return foo.bar.Baz ==> foo/bar/Baz.class.
   * 
   * @param className
   * @return
   */
  public static String classNameToPathName(String className) {
    return className.replace('.', '/') + ".class";
  }

  /**
   * Return foo.bar.Baz ==> foo/bar/Baz.class.
   * 
   * @param className
   * @return
   */
  public static String pathNameToClassName(String pathName) {
    if (pathName.endsWith(".class")) {
      pathName = pathName.substring(0, pathName.length() - ".class".length());
    }

    return pathName.replace('/', '.');
  }

  private Utils() {

  }

}
